package com.example.pertecttime.api;

import com.example.pertecttime.base.BaseResult;
import com.example.pertecttime.entity.User;
import com.example.pertecttime.entity.test;

import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by 半生瓜 on 2017/7/14.
 */

public interface RetrofitService {
    @GET("book/search")
    Observable<test> getSearchBook(
            @Query("q") String name,
            @Query("tag") String tag,
            @Query("start") int start,
            @Query("count") int count);

    @Headers({"Content-Type: application/json", "Accept: application/json", "X-Requested-With: XMLHttpRequest"})
    @POST("login")
    Observable<BaseResult<User>> dologin(
            @Body User user
    );

    @Headers({"Content-Type: application/json"})
    @POST("easyuilogin")
    Observable<BaseResult<test>> dotest(@Body test test);


}
